/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 游戏区域样式 */
.game-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-area {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

#gameCanvas {
    border: 3px solid #333;
    border-radius: 8px;
    background: #f0f0f0;
}

/* 游戏信息样式 */
.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.next-block {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #ddd;
}

.next-block h3 {
    margin-bottom: 10px;
    color: #555;
}

#nextCanvas {
    background: #f0f0f0;
    border-radius: 4px;
}

.score-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #ddd;
}

.score-item label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.score-item div {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a5568;
}

/* 按钮样式 */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 操作说明样式 */
.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #555;
    text-align: center;
}

.instructions ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.instructions li {
    padding: 8px 0;
    color: #666;
}

.instructions strong {
    color: #333;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

/* 游戏结束画面 */
.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.game-over-content h2 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 2rem;
}

.game-over-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}

.game-over-content #finalScore {
    font-weight: bold;
    color: #3498db;
    font-size: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        width: 100%;
        max-width: 300px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .instructions ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .game-wrapper {
        padding: 15px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    h1 {
        font-size: 2rem;
    }
}